<?php


namespace app\backend\validate;


use think\Validate;

class VideoValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'title' => 'require',
        'desc' => 'require',
        'url' => 'require',
        'type' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'title.require' => '请输入标题！',
        'desc.require' => '请输入简介！',
        'url.require' => '请输入路径！',
        'type.require' => '请输入路径！',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'create' => ['title', 'desc', 'url', 'type'],
        'update' => ['title', 'desc', 'url', 'type']
    ];
}